package com.hackerrank.contests.aug13.challenges.reverseshufflemerge;

import java.util.ArrayList;
import java.util.Scanner;

public class Solution {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String S = in.nextLine();
		char[] s = S.toCharArray();
		ArrayList<Integer>[] ind = new ArrayList[26];
		for(int i = 0; i < ind.length; i++)
			ind[i] = new ArrayList<Integer>();
		for(int i = s.length - 1; i >= 0; i--)
			ind[s[i] - 'a'].add(i);
		boolean b[] = new boolean[s.length];
		int p = s.length;
		for(int i = 0; i < ind.length; i++) {
			if(ind[i].size() < 2)
				continue;
			int f = 0;
			while(f < ind[i].size() / 2 && ind[i].get(f) >= p)
				f++;
			for(int j = 0; j < ind[i].size() / 2; j++)
				b[ind[i].get(f + j)] = true;
			p = Math.min(p, ind[i].get(f + ind[i].size() / 2 - 1));
		}
		for(int i = s.length - 1; i >= 0; i--)
			if(b[i])
				System.out.print(s[i]);
		System.out.println();
	}
}
